package com.tiku.common;

import lombok.AllArgsConstructor;
import lombok.Data;

@AllArgsConstructor
@Data
public class ResultJson {
    private Integer code;
    private String message;
    private Object data;

   private ResultJson(Integer code, String message){
       this.code=code;
       this.message=message;
   }
    public static ResultJson success(){
        return new ResultJson(200,"成功");
    }
    public static ResultJson success(Object data){
        return new ResultJson(200,"成功",data);
    }

    /**
     * @param
     * @return
     */
    public static  ResultJson error(Object data){
        return new ResultJson(500,"失败",data);
    }

    public static  ResultJson sysError(){
        return new ResultJson(1000,"系统异常,请联系管理员",null);
    }
}
